﻿using System;
using Discuz.Core;
using Discuz.Services;
using DTcms.BLL;
using System.Collections.Generic;

namespace Discuz.EventStrategy.Timer
{
    /// <summary>
    /// 浏览历史事件
    /// </summary>
    public class BrowseHistoryEvent : IEvent
    {
        public void Execute(object eventInfo)
        {
            EventInfo e = (EventInfo)eventInfo;
            string nowExccute = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            string lastExecute = System.DateTime.Now.AddMinutes((-1)*e.TimeValue).ToString("yyyy-MM-dd HH:mm:ss");
            Dictionary<String, String> pList = new Dictionary<String, String>();
            pList.Add("Ponnysalonxx", "ca1752811add510e6b94c928051f8844ca1752811add510e6b94c928051f8844");
            pList.Add("Ponnysalonxm", "9ff033b8b7991f502975e2a09f3fdebe");
            pList.Add("Ponnysalon", "cc1be796f85bba3f3f035c2fd8d67c87");
            pList.Add("Ponnysalonzt", "661726cc1195beb776b178d4de640a8c");
            foreach (var dic in pList)
            {
                //DTcms.BLL.dotcore bll = new dotcore();
                //int retCount = bll.LoginAndGetData(dic.Key,dic.Value, lastExecute, nowExccute);
                //EventLogs.CreateEventLog(e.Key, string.Format("用户号：{0}，记录数：{1}", "Ponnysalonxx", retCount), Environment.MachineName, DateTime.Now);
            }
            //清空过期浏览历史
            //BrowseHistories.ClearExpiredBrowseHistory();

        }
    }
}
